import { createRouter, createWebHistory } from 'vue-router'
import { makeRoutes } from '@/utils/router.js'
const routerList = [
    {
        path:'/',
        component: () => import('@/views/common.vue'),
        meta:{},
        redirect:'/daily-development',
        children:[
            {
                path:'/daily-development',
                name:'日常记录',
                component: () => import('@/views/dailyDevelopment/dailyDevelopment.vue'),
            },
            {
                path:'/laolai',
                name:'老赖时间表',
                component: () => import('@/views/laoLai/laoLai.vue'),
            },
            {
                path:'/moyu',
                name:'摸鱼办',
                component: () => import('@/views/moyu/moyu.vue'),
            },
            {
                path:'/ces',
                name:'摸鱼办',
                component: () => import('@/views/ces/ces.vue'),
            }
        ]
    },
    {
        name:'登录页',
        path:'/login',
        component: () => import('@/views/login.vue'),
        meta:{},
    }
]
export const router = createRouter({
    history: createWebHistory(),
    routes: makeRoutes(routerList)
})

router.beforeEach((to,from,next) => {
    document.title = to.name
    next()
})